<template>
	<div class="wrapper">
		<!-- header部分 -->
		<header>
			<p>我的信息</p>
		</header>
		
		<!-- 用户部分 -->
		<div class="user-img">
			<i v-if="user.userImg != null">{{user.userImg}}</i>
			<img v-i="user.userImg == null" src="../assets/userImg/yhtx00.jpg">
		</div>
		
		<div class="user-name">
			<p>用户名： {{user.userName}}</p>
		</div>
		
		<!-- logout部分 -->
		<div class="button-logout">
			<button @click ="logout">退出登录</button>
		</div>
		
		<!-- 底部菜单部分 -->
		<Footer></Footer>
	</div>
</template>

<script>
		import Footer from '../components/Footer.vue';
		
		export default {
			name:'Mine',
			data() {
				return {
					user: {},
				}
			},
			created() {
				this.user = this.$getSessionStorage('user');
			},
			methods: {
				logout() {
					this.$removeSessionStorage('user');
					
					this.$router.push({
						path: '/index'
					});
				}
			},
			components: {
				Footer
			}
		}
</script>

<style scoped>
	/****************** 总容器 ******************/
	.wrapper {
		width: 100%;
		height: 100%;
	}

	/****************** header部分 ******************/
	.wrapper header {
		width: 100%;
		height: 12vw;
		background-color: #0097FF;
		color: #fff;
		font-size: 4.8vw;
		position: fixed;
		left: 0;
		top: 0;
		z-index: 1000;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	/****************** 表单部分 ******************/
	.wrapper .user-img{
		padding-top: 15vw;
		
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.wrapper .user-name{
		width: 100%;
		height: 12vw;
		
		font-size: 4.8vw;
		
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.wrapper .button-logout {
		width: 100%;
		box-sizing: border-box;
		padding: 4vw 3vw 0 3vw;
	}
	
	.wrapper .button-logout button {
		width: 100%;
		height: 10vw;
		font-size: 3.8vw;
		font-weight: 700;
		color: #fff;
		background-color: #38CA73;
		border-radius: 4px;
		border: none;
		outline: none;
	}
</style>